package com.spzx.product.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.spzx.common.core.web.controller.BaseController;
import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.product.domain.Category;
import com.spzx.product.service.ICategoryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * <p>
 * 商品分类 前端控制器
 * </p>
 *
 * @author gax
 * @since 2025-08-23
 */
@RestController
@RequestMapping("/category")
public class CategoryController extends BaseController {
    @Autowired
    private ICategoryService categoryService;

    @GetMapping("treeSelect/{parentId}")
    public AjaxResult treeSelect(@PathVariable Long parentId) {
        List<Category> list = categoryService.treeSelect(parentId);
        return AjaxResult.success(list);
    }
}
